using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class PPBOMMap : EntityTypeConfiguration<PPBOM>
    {
        public PPBOMMap()
        {
            // Primary Key
            this.HasKey(t => t.FInterID);

            // Properties
            this.Property(t => t.FBrNo)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.FInterID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FBillNo)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FOrderBillNo)
                .IsRequired()
                .HasMaxLength(255);

            // Table & Column Mappings
            this.ToTable("PPBOM");
            this.Property(t => t.FBrNo).HasColumnName("FBrNo");
            this.Property(t => t.FInterID).HasColumnName("FInterID");
            this.Property(t => t.FBillNo).HasColumnName("FBillNo");
            this.Property(t => t.FTranType).HasColumnName("FTranType");
            this.Property(t => t.FDate).HasColumnName("FDate");
            this.Property(t => t.FBillerID).HasColumnName("FBillerID");
            this.Property(t => t.FCheckerID).HasColumnName("FCheckerID");
            this.Property(t => t.FCheckDate).HasColumnName("FCheckDate");
            this.Property(t => t.FStatus).HasColumnName("FStatus");
            this.Property(t => t.FICMOInterID).HasColumnName("FICMOInterID");
            this.Property(t => t.FCancellation).HasColumnName("FCancellation");
            this.Property(t => t.FItemID).HasColumnName("FItemID");
            this.Property(t => t.FUnitID).HasColumnName("FUnitID");
            this.Property(t => t.FAuxQty).HasColumnName("FAuxQty");
            this.Property(t => t.FType).HasColumnName("FType");
            this.Property(t => t.FStockType).HasColumnName("FStockType");
            this.Property(t => t.FWorkSHop).HasColumnName("FWorkSHop");
            this.Property(t => t.FOrderInterID).HasColumnName("FOrderInterID");
            this.Property(t => t.FOrderBillNo).HasColumnName("FOrderBillNo");
            this.Property(t => t.FChangeTimes).HasColumnName("FChangeTimes");
        }
    }
}
